package com.zilu.digitaltwin.dto.geo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author :caijianbao
 * @date : 2023/1/7 13:31
 */
@Data
public class LayerDTO {

    @JsonProperty("type")
    private String type;
    @JsonProperty("features")
    private List<FeaturesDTO> features;

    public List<FeaturesDTO> getFeatures() {
        if (CollectionUtils.isEmpty(features)) {
            features = new ArrayList<>();
        }
        return features;
    }

    public LayerDTO() {
        this.type = "FeatureCollection";
    }
}
